import java.io.PrintStream;


public class Util {
	public static void printHexArray(byte buffer [], PrintStream out){
	   StringBuilder sb = new StringBuilder();
	   for(byte b: buffer)
	      sb.append(String.format("%02x", b&0xff));
	   out.println(sb.toString());
			
	}
	
	public static byte[] concatArray(byte array1[], byte array2[], int len){
		byte ret[]=new byte[len];
		int y=0;
		
		if (array1!=null){
			for (int x=0;x<array1.length && y<len; x++, y++){
				ret[y]=array1[x];
			}
		}
		
		if (array2!=null){
			for (int x=0;x<array2.length && y<len; x++, y++){
				ret[y]=array2[x];
			}
		}
		return ret;
	}
}
